package com.cloudpolice.door.feignInterface;

import com.cloudpolice.door.feignInterface.hystric.VerifaceInterFaceHystric;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import lh.model.ResultVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 *
 * @author liaoyueli
 * @date 2020-04-15
 */
@Repository
@FeignClient(value = "VERIFACE-MUCON/veriface", fallback = VerifaceInterFaceHystric.class)
public interface VerifaceInterFace {

    /**
     * 图片上传（File方式）
     *
     * @param fileStr 经base64编码的图片字符串
     * @param face 人脸图片属性，true-进行人脸检测，false-不进行人脸检测
     * @param type 上传图片类型，0-检索上传，1-布控上传，2-红名单上传
     * @return JSON格式数据
     */
    @PostMapping("/imageUpload")
    ResultVO imageUpload(@RequestParam(value = "fileStr") String fileStr,
                            @RequestParam(value = "face") String face,
                            @RequestParam(value = "type") String type);

    /**
     * 录入静态库人员
     *
     * @param imageIds 图片ID组，多张id以,分割
     * @param type 录入人员类型，统一使用7表示静态库人员
     * @param idNo 身份证号
     * @param sex 性别
     * @param address 地址
     * @param name 姓名
     * @return JSON格式数据
     */
    @PostMapping("/enterStaffInfo")
    ResultVO enterStaffInfo(@RequestParam(value = "imageIds") String imageIds,
                               @RequestParam(value = "type") String type,
                               @RequestParam(value = "idNo", required = false) String idNo,
                               @RequestParam(value = "sex", required = false) String sex,
                               @RequestParam(value = "address", required = false) String address,
                               @RequestParam(value = "name", required = false) String name);

    /**
     * 根据大图id获取所有小图信息
     *
     * @param id 图片ID
     * @return JSON格式数据
     */
    @PostMapping("/getDetectByImageId")
    ResultVO getDetectImage(@RequestParam(value = "id") String id);

    /**
     * 通用检索
     *
     * @param faceIds 人脸ID组
     * @param searchType 检索库类型，3-户籍人员库，4-居住人员库，5-在逃人员，6-警综库人员，11-人证采集库
     * @param startTime 数据开始时间
     * @param endTime 数据结束时间
     * @param page page
     * @param pageSize pageSize
     * @return JSON格式数据
     */
    @PostMapping("/searchFaceByPage")
    public ResultVO<?> searchFaceByPage(@RequestParam(value = "faceIds") String faceIds,
                                        @RequestParam(value = "searchType") String searchType,
                                        @RequestParam(value = "startTime") String startTime,
                                        @RequestParam(value = "endTime") String endTime,
                                        @RequestParam(value = "page", defaultValue = "1") String page,
                                        @RequestParam(value = "pageSize") String pageSize);
}
